using FluentValidation;
using netCoreStudy.Dto.User;
using netCoreStudy.IService;

namespace netCoreStudy.DtoValidator
{
	public class LoginUserDtoValidator : AbstractValidator<LoginUserDto>
	{
		public LoginUserDtoValidator(IRoleService roleService, IMenuService menuService)
		{
			RuleFor(x => x.Name)
				.NotNull()
				.NotEmpty()
				.WithName("用户名")
				.WithMessage("{PropertyName}不能为空!")
				;
			RuleFor(x => x.Pass)
				.NotNull()
				.NotEmpty()
				.WithName("用户名")
				.WithMessage("{PropertyName}不能为空!")
				;

		}
	}
}